# Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website>

_realname=texlive-core
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2021.20210424
_revnr=${pkgver#2021.}
pkgrel=2
pkgdesc="TeX Live core distribution (mingw-w64)"
license=('GPL')
arch=('any')
depends=(
   "${MINGW_PACKAGE_PREFIX}-texlive-bin"
   "${MINGW_PACKAGE_PREFIX}-perl"
)
optdepends=(
  #'dialog:      for texconfig'
  "${MINGW_PACKAGE_PREFIX}-ghostscript: for epstopdf, epspdf and other ConTeXt tools"
  #'java-runtime: for utilities like arara, texplate'
  #'perl-tk:     for texdoctk'
  #'psutils:     to manipulate the output of dvips'
  "${MINGW_PACKAGE_PREFIX}-python:      for de-macro, dviasm, pythontex"
  "${MINGW_PACKAGE_PREFIX}-ruby:        for old ConTeXT MkII and epspdf"
  #"t1utils:     can be useful when installing Type1 fonts"
)
groups=("${MINGW_PACKAGE_PREFIX}-texlive-most")
conflicts=(
   "${MINGW_PACKAGE_PREFIX}-tetex"
   "${MINGW_PACKAGE_PREFIX}-texlive-latex3"
   "${MINGW_PACKAGE_PREFIX}-pdfjam"
   "${MINGW_PACKAGE_PREFIX}-texlive-genericextra"
   "${MINGW_PACKAGE_PREFIX}-texlive-plainextra"
)
provides=(
   "${MINGW_PACKAGE_PREFIX}-tetex"
   "${MINGW_PACKAGE_PREFIX}-texlive-latex3"
   "${MINGW_PACKAGE_PREFIX}-pdfjam"
   "${MINGW_PACKAGE_PREFIX}-texlive-genericextra"
   "${MINGW_PACKAGE_PREFIX}-texlive-plainextra"
)
replaces=(
   "${MINGW_PACKAGE_PREFIX}-tetex"
   "${MINGW_PACKAGE_PREFIX}-texlive-latex3"
   "${MINGW_PACKAGE_PREFIX}-pdfjam"
   "${MINGW_PACKAGE_PREFIX}-texlive-genericextra"
   "${MINGW_PACKAGE_PREFIX}-texlive-plainextra"
)
url='http://tug.org/texlive/'
source=("https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/texlive-core-${_revnr}.tar.xz"
        "$_realname.maps::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}.maps"
        "$_realname.fmts::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}.fmts"
        "$_realname.dat::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}.dat"
        "$_realname.dat.lua::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}.dat.lua"
        "$_realname.def::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}.def"
        "mktexlsr.hook.in"
        "mktexlsr.script.in"
        "texlive-updmap.hook.in"
        "texlive-updmap.script.in"
        "texlive-fmtutil.hook.in"
        "texlive-fmtutil.script.in"
        "texmf.cnf.in"
        "texmfcnf.lua.in"
        "09-texlive-fonts.conf.in")
install=${_realname}-${MSYSTEM}.install
backup=("${MINGW_PREFIX:1}/etc/texmf/web2c/texmf.cnf"
         "${MINGW_PREFIX:1}/etc/texmf/chktex/chktexrc"
         "${MINGW_PREFIX:1}/etc/texmf/dvipdfmx/dvipdfmx.cfg"
         "${MINGW_PREFIX:1}/etc/texmf/dvips/config/config.ps"
         "${MINGW_PREFIX:1}/etc/texmf/tex/generic/config/language.dat"
         "${MINGW_PREFIX:1}/etc/texmf/tex/generic/config/language.def"
         "${MINGW_PREFIX:1}/etc/texmf/tex/generic/tex-ini-files/pdftexconfig.tex"
         "${MINGW_PREFIX:1}/etc/texmf/ttf2pk/ttf2pk.cfg"
         "${MINGW_PREFIX:1}/etc/texmf/web2c/fmtutil.cnf"
         "${MINGW_PREFIX:1}/etc/texmf/web2c/mktex.cnf"
         "${MINGW_PREFIX:1}/etc/texmf/xdvi/XDvi")
sha256sums=('b51d381e3eafc3ab228fa6334873c103890774ed1696b0372243d72b87a4f057'
            '92cde6a5f11c4d1709d61a278d3f7e315654b62d8cf41dffc4157fd264d0094d'
            'ac365205a0d57fac5ee1d898e8aa22957f937865b7a11bff0c01231927e840ec'
            'c1b678210bd2ce220d0866b0b0b2a59d11616ffe356e8cb74525bc2fb8c40d9f'
            'a0e9859ccbfc51b21660af389557a4343ce61cb77e6161f1b00d80277da87724'
            '849f0f5388b9bc4e4982b1c95a26924a14e1c3d942af125df0d7b7de53cd50ff'
            '542f68cd8e1a00f1598db8532e70e1bb77adc0516daee84e5aa92707f58fdf04'
            '773e9c8f60c4241a57adafda8abac765c53f7e6e24c86b87366b037ade29077b'
            'bffaa8a7f5d78aed138a760dfa1073ad7c419a61a9739cafbc28dce330aae911'
            'e154d58543dc8d9957f502b3d162023f0be4a650860d3be5289ff2ac880ccca2'
            'd615d040d1943bcdf7b1c7a649644a7bd47703317b79963062a058e1300602f3'
            'dd286733d0b596708ee049aa22d641129d20f61113298c6f11ad37500bf9f1fb'
            '3bc32f119b672015d75d136a3a506efefac6f7b8e01a9a6c95c10c4336931b26'
            '8ededf35132ffbe26434c0c778b3d4a159ce428452abe6ebc8d94161f02bd7e9'
            '87eddde958848d041ded1625e14009e89b3bd5953e7ae39b6aac2f65d3856485')

build() {
   cd "$srcdir"
   echo -n "   --> extracting all packages... "
   for p in *.tar.xz; do 
     bsdtar -xf $p
   done
   echo "done"
   rm -rf source doc
}

copy_file_message() {
   local from="$1"
   local to="$2"
   msg2 "Copying $from to $to"
   cp $from $to
}

package() {
   cd "$srcdir"

   msg "Installing Pacman hooks"
   # First lets sed all files for prefix changes.
   for hook in 'mktexlsr' 'texlive-fmtutil' 'texlive-updmap'; do
      local hook_path="${srcdir}/${MINGW_PACKAGE_PREFIX}-${hook}.hook"
      cp "${srcdir}/${hook}.hook.in" "${hook_path}"
      sed -s "s|@MINGW_HOOK_TARGET_PREFIX@|${MINGW_PREFIX:1}|g" -i "${hook_path}"
      sed -s "s|@MINGW_PREFIX@|${MINGW_PREFIX}|g" -i "${hook_path}"
      sed -s "s|@MINGW_PACKAGE_PREFIX@|${MINGW_PACKAGE_PREFIX}|g" -i "${hook_path}"
      sed -s "s|@TEMP@|$(cygpath -w $TMP)|g" -i "${hook_path}"
      install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 "${hook_path}"
   done

  for script in 'mktexlsr' 'texlive-fmtutil' 'texlive-updmap'; do
      local script_path="${srcdir}/${MINGW_PACKAGE_PREFIX}-${script}.script"
      cp "${srcdir}/${script}.script.in" "${script_path}"
      sed -s "s|@MINGW_PREFIX@|${MINGW_PREFIX}|g" -i "${script_path}"
      sed -s "s|@MINGW_HOOK_TARGET_PREFIX@|${MINGW_PREFIX:1}|g" -i "${script_path}"
      install -Dt "$pkgdir/usr/share/libalpm/scripts" -m644 "${script_path}"
   done

   for file_conf in '09-texlive-fonts.conf' 'texmfcnf.lua' 'texmf.cnf'; do
      local conf_path="${srcdir}/${file_conf}"
      cp "${srcdir}/${file_conf}.in" "${conf_path}"
      sed -s "s|@MINGW_HOOK_TARGET_PREFIX@|${MINGW_PREFIX:1}|g" -i "${conf_path}"
      sed -s "s|@MINGW_PREFIX@|${MINGW_PREFIX}|g" -i "${conf_path}"
      sed -s "s|@MINGW_PACKAGE_PREFIX@|${MINGW_PACKAGE_PREFIX}|g" -i "${conf_path}"
      sed -s "s|@TEMP@|$(cygpath -u $TMP)|g" -i "${conf_path}"
   done

   msg "Installing Package"
   # Install packages.
   install -m755 -d "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs"
   sed -i '/^#/d' CONTENTS
   install -m644 CONTENTS "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/${pkgname}_${_revnr}.pkgs"
   install -m644 $_realname.maps "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/"
   install -m644 $_realname.fmts "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/"
   
   # language files for hooks
   sed -i 's/\% test//' $_realname.dat
   install -m644 $_realname.dat "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/"
   
   sed -i 's/-- test//' $_realname.dat.lua
   install -m644 $_realname.dat.lua "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/"
   
   sed -i 's/\% test//' $_realname.def
   install -m644 $_realname.def "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/"

   install -m755 -d "${pkgdir}${MINGW_PREFIX}/share"
   wanteddirs=$(for d in *; do test -d $d && [[ $d != texmf* ]] && echo $d; done) || true
   for dir in $wanteddirs; do
     find $dir -type d -exec install -d -m755 "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/'{}' \;
     find $dir -type f -exec install -m644 '{}' "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/'{}' \;
   done
   find texmf-dist -type d -exec install -d -m755 "${pkgdir}${MINGW_PREFIX}"/share/'{}' \;
   find texmf-dist -type f -exec install -m644 '{}' "${pkgdir}${MINGW_PREFIX}"/share/'{}' \;
   find texmf-dist -type f -executable -exec chmod 755 "${pkgdir}${MINGW_PREFIX}"/share/'{}' \;
 
   #############################################################
   ### install texmf tree
   msg "Installing the /etc/texmf tree"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/web2c/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/chktex/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/dvips/config/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/dvipdfmx/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/config/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/tex-ini-files/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/ttf2pk/"
   install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/xdvi/"

   install -d -m755 "${pkgdir}${MINGW_PREFIX}/share/fontconfig/conf.avail"
   install -m644 "$srcdir"/09-texlive-fonts.conf \
   	  "${pkgdir}${MINGW_PREFIX}/share/fontconfig/conf.avail/"

   # Remove manpages (already in texlive-bin).
   rm -rf "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/doc/man"

   msg "Copying config files to TEXMFCONFIG tree"
   # copy config files to $TEXMFCONFIG tree
   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/chktex/chktexrc" \
     	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/chktex/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/web2c/mktex.cnf" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/web2c/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/web2c/updmap-hdr.cfg" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/web2c/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/web2c/fmtutil-hdr.cnf" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/web2c/fmtutil.cnf"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/dvips/config/config.ps" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/dvips/config/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/dvipdfmx/dvipdfmx.cfg" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/dvipdfmx/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/tex-ini-files/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/tex/generic/config/language.us" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/config/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/tex/generic/config/language.us.def" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/config/"
   
   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/tex/generic/config/language.us.lua" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/tex/generic/config/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/ttf2pk/ttf2pk.cfg" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/ttf2pk/"

   copy_file_message "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/xdvi/XDvi" \
   	  "${pkgdir}${MINGW_PREFIX}/etc/texmf/xdvi/"

   msg 'remove TL specific warnings in the language.{dat,def} files'
   # remove TL specific warnings in the language.{dat,def} files:
   sed -i -e '/DO NOT EDIT/,+3 d' "${pkgdir}${MINGW_PREFIX}"/etc/texmf/tex/generic/config/language.*

   msg "Replace upstream texmf.cnf with ours"
   # replace upstream texmf.cnf with ours
   rm -f "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/web2c/texmf.cnf
   install -m644 "$srcdir"/texmf.cnf "${pkgdir}${MINGW_PREFIX}"/etc/texmf/web2c/texmf.cnf
   install -m644 "${pkgdir}${MINGW_PREFIX}"/etc/texmf/web2c/texmf.cnf "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/web2c/texmf.cnf
   # replace upstream texmfcnf.lua with ours
   install -m644 "$srcdir"/texmfcnf.lua "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/web2c/texmfcnf.lua

   msg "Configure Languages Hypens"
   # remove upstream's language.*
   rm -f "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/tex/generic/config/language.dat
   rm -f "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/tex/generic/config/language.def
   rm -f "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/tex/generic/config/language.dat.lua

   msg "Install Perl libraries"
   # install Perl libraries
   mv "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/tlpkg "${pkgdir}${MINGW_PREFIX}"/share
   rm -rf "${pkgdir}${MINGW_PREFIX}"/share/tlpkg/tlpobj

   msg "remove Upstream updmap.cfg and fmtutil.cnf"
   # remove upstream updmap.cfg: it contains too many maps.
   rm "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/web2c/updmap.cfg"
   # remove upstream fmtutil.cnf: it will be autogenerated
   rm "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/web2c/fmtutil.cnf"

   # Create lauchers for all these Scripts.
   # There is a `runscript.exe` which can be copied
   # with these script names and things should work 
   # automatically. It is from texlive-bin
   msg "Creating Launchers."
   # get the list from 
   # https://github.com/TeX-Live/texlive-source/blob/<commit>/texk/texlive/linked_scripts/scripts.lst
   _linked_scripts="
a2ping/a2ping.pl
accfonts/mkt1font
accfonts/vpl2ovp
accfonts/vpl2vpl
adhocfilelist/adhocfilelist.sh
albatross/albatross.sh
arara/arara.sh
attachfile2/pdfatfi.pl
bundledoc/arlatex
bundledoc/bundledoc
checkcites/checkcites.lua
checklistings/checklistings.sh
chklref/chklref.pl
chktex/chkweb.sh
chktex/deweb.pl
cjk-gs-integrate/cjk-gs-integrate.pl
clojure-pamphlet/pamphletangler
cluttex/cluttex.lua
context/perl/mptopdf.pl
context/stubs/unix/context
context/stubs/unix/contextjit
context/stubs/unix/luatools
context/stubs/unix/mtxrun
context/stubs/unix/mtxrunjit
context/stubs/unix/texexec
context/stubs/unix/texmfstart
ctan-o-mat/ctan-o-mat.pl
ctanbib/ctanbib
ctanify/ctanify
ctanupload/ctanupload.pl
de-macro/de-macro
dosepsbin/dosepsbin.pl
dtxgen/dtxgen
dviasm/dviasm.py
dviinfox/dviinfox.pl
epstopdf/epstopdf.pl
findhyph/findhyph
fontools/afm2afm
fontools/autoinst
fontools/ot2kpx
fragmaster/fragmaster.pl
git-latexdiff/git-latexdiff
installfont/installfont-tl
jfmutil/jfmutil.pl
ketcindy/ketcindy.sh
latex-git-log/latex-git-log
latex-papersize/latex-papersize.py
latex2man/latex2man
latex2nemeth/latex2nemeth
latexdiff/latexdiff-vc.pl
latexdiff/latexdiff.pl
latexdiff/latexrevise.pl
latexfileversion/latexfileversion
latexindent/latexindent.pl
latexmk/latexmk.pl
latexpand/latexpand
light-latex-make/llmk.lua
ltxfileinfo/ltxfileinfo
ltximg/ltximg.pl
luaotfload/luaotfload-tool.lua
lwarp/lwarpmk.lua
make4ht/make4ht
match_parens/match_parens
mf2pt1/mf2pt1.pl
mkjobtexmf/mkjobtexmf.pl
pdfbook2/pdfbook2
pdfcrop/pdfcrop.pl
pdfjam/pdfjam
pdflatexpicscale/pdflatexpicscale.pl
pdftex-quiet/pdftex-quiet
pdfxup/pdfxup
pfarrei/a5toa4.tlu
pfarrei/pfarrei.tlu
pkfix-helper/pkfix-helper
pkfix/pkfix.pl
ps2eps/ps2eps.pl
purifyeps/purifyeps
pythontex/depythontex.py
pythontex/pythontex.py
simpdftex/simpdftex
spix/spix.py
srcredact/srcredact.pl
sty2dtx/sty2dtx.pl
tex4ebook/tex4ebook
tex4ht/ht.sh
tex4ht/htcontext.sh
tex4ht/htlatex.sh
tex4ht/htmex.sh
tex4ht/httex.sh
tex4ht/httexi.sh
tex4ht/htxelatex.sh
tex4ht/htxetex.sh
tex4ht/mk4ht.pl
tex4ht/xhlatex.sh
texcount/texcount.pl
texdef/texdef.pl
texdiff/texdiff
texdirflatten/texdirflatten
texdoc/texdoc.tlu
texdoctk/texdoctk.pl
texfot/texfot.pl
texlive-extra/allcm.sh
texlive-extra/allneeded.sh
texlive-extra/dvi2fax.sh
texlive-extra/dvired.sh
texlive-extra/e2pall.pl
texlive-extra/fontinst.sh
texlive-extra/kpsetool.sh
texlive-extra/kpsewhere.sh
texlive-extra/ps2frag.sh
texlive-extra/pslatex.sh
texlive-extra/texconfig-dialog.sh
texlive-extra/texconfig-sys.sh
texlive-extra/texconfig.sh
texlive-extra/texlinks.sh
texlive/fmtutil-sys.sh
texlive/fmtutil-user.sh
texlive/fmtutil.pl
texlive/mktexmf
texlive/mktexpk
texlive/mktextfm
texlive/rungs.tlu
texlive/updmap-sys.sh
texlive/updmap-user.sh
texlive/updmap.pl
texliveonfly/texliveonfly.py
texloganalyser/texloganalyser
texplate/texplate.sh
thumbpdf/thumbpdf.pl
typeoutfileinfo/typeoutfileinfo.sh
xindex/xindex.lua
xindy/texindy.pl
xindy/xindy.pl
listings-ext/listings-ext.sh
"
    install -m755 -d "${pkgdir}${MINGW_PREFIX}"/bin
    for _script in ${_linked_scripts}; do
        _scriptbase=$(basename $_script)
        _scriptbase=${_scriptbase%.*}
        install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/${_scriptbase}.exe"
    done

   # now copy mktexlsr
   install -D -m755 "${pkgdir}${MINGW_PREFIX}/share/texmf-dist/scripts/texlive/mktexlsr.pl" \
     	  "${pkgdir}${MINGW_PREFIX}/bin/mktexlsr"

   msg "Creating additional symlinks."

   # additional installs links
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/allec.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/cllualatex.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/clxelatex.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/repstopdf.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/mktexfmt.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/kpsepath.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/kpsexpand.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/mkluatexfontdb.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/texhash.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/rpdfcrop.exe"
   install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/latexdef.exe"
}
